CREATE TABLE CRST_AP_INVOICES
(
  INVOICE_ID                     NUMBER(15),
  LAST_UPDATE_DATE               DATE,
  LAST_UPDATED_BY                NUMBER(15),
  VENDOR_ID                      NUMBER(15),
  INVOICE_NUM                    VARCHAR2(50 BYTE),
  SET_OF_BOOKS_ID                NUMBER(15),
  INVOICE_CURRENCY_CODE          VARCHAR2(15 BYTE),
  PAYMENT_CURRENCY_CODE          VARCHAR2(15 BYTE),
  PAYMENT_CROSS_RATE             NUMBER ,
  INVOICE_AMOUNT                 NUMBER,
  VENDOR_SITE_ID                 NUMBER(15),
  AMOUNT_PAID                    NUMBER,
  DISCOUNT_AMOUNT_TAKEN          NUMBER,
  INVOICE_DATE                   DATE,
  SOURCE                         VARCHAR2(25 BYTE),
  INVOICE_TYPE_LOOKUP_CODE       VARCHAR2(25 BYTE),
  DESCRIPTION                    VARCHAR2(240 BYTE),
  BATCH_ID                       NUMBER(15),
  AMOUNT_APPLICABLE_TO_DISCOUNT  NUMBER,
  TAX_AMOUNT                     NUMBER,
  TERMS_ID                       NUMBER(15),
  TERMS_DATE                     DATE,
  PAYMENT_METHOD_LOOKUP_CODE     VARCHAR2(25 BYTE),
  PAY_GROUP_LOOKUP_CODE          VARCHAR2(25 BYTE),
  ACCTS_PAY_CODE_COMBINATION_ID  NUMBER(15),
  PAYMENT_STATUS_FLAG            VARCHAR2(1 BYTE),
  CREATION_DATE                  DATE,
  CREATED_BY                     NUMBER(15),
  BASE_AMOUNT                    NUMBER,
  VAT_CODE                       VARCHAR2(15 BYTE),
  LAST_UPDATE_LOGIN              NUMBER(15),
  EXCLUSIVE_PAYMENT_FLAG         VARCHAR2(1 BYTE),
  PO_HEADER_ID                   NUMBER(15),
  FREIGHT_AMOUNT                 NUMBER,
  GOODS_RECEIVED_DATE            DATE,
  INVOICE_RECEIVED_DATE          DATE,
  VOUCHER_NUM                    VARCHAR2(50 BYTE),
  APPROVED_AMOUNT                NUMBER,
  RECURRING_PAYMENT_ID           NUMBER(15),
  EXCHANGE_RATE                  NUMBER,
  EXCHANGE_RATE_TYPE             VARCHAR2(30 BYTE),
  EXCHANGE_DATE                  DATE,
  EARLIEST_SETTLEMENT_DATE       DATE,
  ORIGINAL_PREPAYMENT_AMOUNT     NUMBER,
  DOC_SEQUENCE_ID                NUMBER,
  DOC_SEQUENCE_VALUE             NUMBER,
  DOC_CATEGORY_CODE              VARCHAR2(30 BYTE),
  ATTRIBUTE1                     VARCHAR2(150 BYTE),
  ATTRIBUTE2                     VARCHAR2(150 BYTE),
  ATTRIBUTE3                     VARCHAR2(150 BYTE),
  ATTRIBUTE4                     VARCHAR2(150 BYTE),
  ATTRIBUTE5                     VARCHAR2(150 BYTE),
  ATTRIBUTE6                     VARCHAR2(150 BYTE),
  ATTRIBUTE7                     VARCHAR2(150 BYTE),
  ATTRIBUTE8                     VARCHAR2(150 BYTE),
  ATTRIBUTE9                     VARCHAR2(150 BYTE),
  ATTRIBUTE10                    VARCHAR2(150 BYTE),
  ATTRIBUTE11                    VARCHAR2(150 BYTE),
  ATTRIBUTE12                    VARCHAR2(150 BYTE),
  ATTRIBUTE13                    VARCHAR2(150 BYTE),
  ATTRIBUTE14                    VARCHAR2(150 BYTE),
  ATTRIBUTE15                    VARCHAR2(150 BYTE),
  ATTRIBUTE_CATEGORY             VARCHAR2(150 BYTE),
  APPROVAL_STATUS                VARCHAR2(25 BYTE),
  APPROVAL_DESCRIPTION           VARCHAR2(240 BYTE),
  INVOICE_DISTRIBUTION_TOTAL     NUMBER,
  POSTING_STATUS                 VARCHAR2(15 BYTE),
  PREPAY_FLAG                    VARCHAR2(1 BYTE),
  AUTHORIZED_BY                  VARCHAR2(25 BYTE),
  CANCELLED_DATE                 DATE,
  CANCELLED_BY                   NUMBER(15),
  CANCELLED_AMOUNT               NUMBER,
  TEMP_CANCELLED_AMOUNT          NUMBER,
  PROJECT_ACCOUNTING_CONTEXT     VARCHAR2(30 BYTE),
  USSGL_TRANSACTION_CODE         VARCHAR2(30 BYTE),
  USSGL_TRX_CODE_CONTEXT         VARCHAR2(30 BYTE),
  PROJECT_ID                     NUMBER(15),
  TASK_ID                        NUMBER(15),
  EXPENDITURE_TYPE               VARCHAR2(30 BYTE),
  EXPENDITURE_ITEM_DATE          DATE,
  PA_QUANTITY                    NUMBER(22,5),
  EXPENDITURE_ORGANIZATION_ID    NUMBER(15),
  PA_DEFAULT_DIST_CCID           NUMBER(15),
  VENDOR_PREPAY_AMOUNT           NUMBER,
  PAYMENT_AMOUNT_TOTAL           NUMBER,
  AWT_FLAG                       VARCHAR2(1 BYTE),
  AWT_GROUP_ID                   NUMBER(15),
  REFERENCE_1                    VARCHAR2(30 BYTE),
  REFERENCE_2                    VARCHAR2(30 BYTE),
  ORG_ID                         NUMBER(15),
  PRE_WITHHOLDING_AMOUNT         NUMBER,
  GLOBAL_ATTRIBUTE_CATEGORY      VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE1              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE2              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE3              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE4              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE5              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE6              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE7              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE8              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE9              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE10             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE11             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE12             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE13             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE14             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE15             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE16             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE17             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE18             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE19             VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE20             VARCHAR2(150 BYTE),
  AUTO_TAX_CALC_FLAG             VARCHAR2(1 BYTE),
  PAYMENT_CROSS_RATE_TYPE        VARCHAR2(30 BYTE),
  PAYMENT_CROSS_RATE_DATE        DATE,
  PAY_CURR_INVOICE_AMOUNT        NUMBER,
  MRC_BASE_AMOUNT                VARCHAR2(2000 BYTE),
  MRC_EXCHANGE_RATE              VARCHAR2(2000 BYTE),
  MRC_EXCHANGE_RATE_TYPE         VARCHAR2(2000 BYTE),
  MRC_EXCHANGE_DATE              VARCHAR2(2000 BYTE),
  GL_DATE                        DATE,
  AWARD_ID                       NUMBER(15),
  PAID_ON_BEHALF_EMPLOYEE_ID     NUMBER(15),
  AMT_DUE_CCARD_COMPANY          NUMBER,
  AMT_DUE_EMPLOYEE               NUMBER,
  APPROVAL_READY_FLAG            VARCHAR2(1 BYTE),
  APPROVAL_ITERATION             NUMBER(9),
  WFAPPROVAL_STATUS              VARCHAR2(50 BYTE),
  REQUESTER_ID                   NUMBER(10),
  DUMMY                          CHAR(1),
  LAST_UPDATED_BY_NAME           VARCHAR2(100),
  VENDOR_NAME                    VARCHAR2(240),
  VENDOR_NUMBER                  VARCHAR2(100),
  SOB_SHORT_NAME                 VARCHAR2(100),
  VENDOR_SITE_CODE               VARCHAR2(100),
  BATCH_NAME                     VARCHAR2(100),
  BATCH_DATE                     DATE,
  AP_TERM                        VARCHAR2(100),
  CREATED_BY_NAME                VARCHAR2(100),
  AUTHORIZED_BY_NAME             VARCHAR2(100),
  CANCELLED_BY_NAME              VARCHAR2(100),
  PA_DEFAULT_DIST_CCID_D         VARCHAR2(100),
  ORG_NAME                       VARCHAR2(100),
  REQUESTER_NAME                 VARCHAR2(100)
);